package com.attendance.mapper;

import com.attendance.Utils.SQLProvider;
import com.attendance.model.Biz.BizVacation;
import com.attendance.model.Form.VacationForm;
import com.attendance.model.Vacation;
import com.baomidou.mybatisplus.mapper.AutoMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 *
 * Vacation 表数据库控制层接口
 *
 */
@Mapper
public interface VacationMapper extends AutoMapper<Vacation>{

    @SelectProvider(type = SQLProvider.class, method = "queryBizVacation")
    public List<BizVacation> getAll(VacationForm vacationForm);

    @Select("select * from vacation v where v.uid=#{uid}")
    public List<Vacation> getByUid(@Param("uid") Integer uid);

    @Select("select * from vacation v where v.uid=#{uid} and v.type=#{type}" )
    public  Vacation getByUidAndType(@Param("uid") Integer uid, @Param("type") Integer type);
}